/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Persistencia;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.LinkedList;
import Logica.TipoReunion;
import Logica.Reunion;

/**
 *
 * @author Matias
 */
public class ADOReunion {

    private Singleton_Conexion datosconexion;
    Connection conexion;

    public ADOReunion() {
        try {
            Class.forName(datosconexion.getInstancia().getDriver());
            conexion = DriverManager.getConnection(datosconexion.getInstancia().getProtocolo());
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        } catch (java.sql.SQLException e1) {
            e1.printStackTrace();
        }
    }
    
    public boolean agregarTipoReunion(TipoReunion t)
    {
        String sentencia = "Insert Into tipoReunion (nombre, id) values(?,?)";
        PreparedStatement st;   
        try{
          
            st= conexion.prepareStatement(sentencia);
            st.setString(1, t.getNombre());
            st.setInt(2,t.getId());
            
            st.execute();
            st.close();
            return true;
        }
        catch(java.sql.SQLException e1){
            e1.printStackTrace();
            return false;
        }
      
    
    }
}
